Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

[WIP] Use haskell-lsp with VFS race condition fix #1446

Closed
wants to merge 2 commits into from

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Nov 10, 2019

Use work @mpickering has done to get rid of race conditions in VFS

Do not merge, this is a test branch, to confirm operation prior to publishing new haskell-lsp and lsp-test modules.


-- The commands to be executed on the server.
-- If you set `executeCommandHandler`, you **must** set this.
, Core.executeCommandCommands = Just commandIds
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if these are set up correctly, please provide input.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either is this @bubba who changed it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a branch for these options, I'll apply it on top of this after this is merged /~https://github.com/bubba/haskell-ide-engine/tree/new-haskell-lsp-options

Copy link
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me but no changes would have had to have been made if VIrtualFile was abstract and there was an accessor to extract the Text.

@@ -275,7 +275,7 @@ readVFS :: (MonadIde m, MonadIO m) => Uri -> m (Maybe T.Text)
readVFS uri = do
mvf <- getVirtualFile uri
case mvf of
Just (VirtualFile _ txt _) -> return $ Just (Rope.toText txt)
Just (VirtualFile _ txt) -> return $ Just (Rope.toText txt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make VirtualFile more abstract and provide an accessor to get the text out (I have this on my dejafu branch).

(Just (VFS.VirtualFile _ yitext _), Just fp) -> do
let text' = Rope.toString yitext
(Just (VFS.VirtualFile _ rope), Just fp) -> do
let text' = Rope.toString rope
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -798,7 +799,7 @@ withDocumentContents reqId uri f = do
(J.responseId reqId)
J.InvalidRequest
"Document was not open"
Just (VFS.VirtualFile _ txt _) -> f (Rope.toText txt)
Just (VFS.VirtualFile _ txt) -> f (Rope.toText txt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here..


-- The commands to be executed on the server.
-- If you set `executeCommandHandler`, you **must** set this.
, Core.executeCommandCommands = Just commandIds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either is this @bubba who changed it?

@alanz
Copy link
Collaborator Author

alanz commented Nov 17, 2019

Closed in favour of #1457

@alanz alanz closed this Nov 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants